﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPF_UI_My_Demo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            var uiMessageBox = new Wpf.Ui.Controls.MessageBox
            {
                Title = "标题",
                Content =
                "这是优化后的提示窗口",
            };

            _ = await uiMessageBox.ShowDialogAsync();

            tips.IsOpen = true;
        }

        private void ToggleSwitch_Checked(object sender, RoutedEventArgs e)
        {
            var tgn = (ToggleButton)sender;
            Wpf.Ui.Appearance.ApplicationThemeManager.Apply(
tgn.IsChecked == true ? Wpf.Ui.Appearance.ApplicationTheme.Dark : Wpf.Ui.Appearance.ApplicationTheme.Light, // Theme type
Wpf.Ui.Controls.WindowBackdropType.Mica,  // Background type
true                                      // Whether to change accents automatically
);
        }

    }
}